package com.cmcc.shared.model

import android.os.Parcel
import android.os.Parcelable


/**
 * Author: jiangxin
 * Date: 2019/11/15
 * Description:
 */
data class OrderRecord(
    var bountyFee: String? = null,

    var startTime: String? = null,
    var createTime: String? = null,
    var driverCarId: String? = null,
    var driverCarIdCard: String? = null,
    var driverCarModel: String? = null,
    var driverId: String? = null,
    var driverPhone: String? = null,
    var durationFee: String? = null,
    var endAddress: String? = null,

    var id: String? = null,
    var mileageFee: String? = null,
    var orderNumber: String? = null,
    var overTime: String? = null,
    var passengerId: String? = null,
    var passengerPhone: String? = null,
    var payMethod: String? = null,
    var remark: String? = null,
    var startAddress: String? = null,

    var stationIndex: String? = null,
    var status: Int? = null,
    var totalAmount: String? = null,

    var type: Int = 1
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),

        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),

        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),

        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),

        parcel.readInt()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(bountyFee)

        parcel.writeString(startTime)
        parcel.writeString(createTime)
        parcel.writeString(driverCarId)
        parcel.writeString(driverCarIdCard)
        parcel.writeString(driverCarModel)
        parcel.writeString(driverId)
        parcel.writeString(driverPhone)
        parcel.writeString(durationFee)
        parcel.writeString(endAddress)

        parcel.writeString(id)
        parcel.writeString(mileageFee)
        parcel.writeString(orderNumber)
        parcel.writeString(overTime)
        parcel.writeString(passengerId)
        parcel.writeString(passengerPhone)
        parcel.writeString(payMethod)
        parcel.writeString(remark)
        parcel.writeString(startAddress)
        parcel.writeString(stationIndex)
        parcel.writeInt(status ?: 0)
        parcel.writeString(totalAmount)
        parcel.writeInt(type)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<OrderRecord> {
        override fun createFromParcel(parcel: Parcel): OrderRecord {
            return OrderRecord(parcel)
        }

        override fun newArray(size: Int): Array<OrderRecord?> {
            return arrayOfNulls(size)
        }
    }
}